﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using HNQXYJ.Model;
using HNQXYJ.BLL;
namespace HNQXYJ.HN_DATA
{
    public partial class CountyStatistics : System.Web.UI.Page
    {
        public string rankName;
        string rankLevel;
        public string returnValue = "";
        public string xAxisCategories = "";
        protected void Page_Load(object sender, EventArgs e)
        {
            rankName = Session["rankname"].ToString();
            rankLevel = Session["ranklevel"].ToString();
            xAxisCategories = "['" + rankName + "']";
            returnValue = GetDataString();
        }
       

        //获取对应县区的数据
        public string GetDataString()
        {
           string s = "";
           
           int  dataAll = TerminalBLL.GetNumberALLByRankLevel(rankLevel , "0");
           int dataOnline = TerminalBLL.GetNumberByStatusAndCounty("在线", rankLevel , "0");
           int dataOffline = TerminalBLL.GetNumberByStatusAndCounty("离线", rankLevel, "0");
           
            s += "[{name: '终端总数量',data:[" + dataAll + "]}, {name: '终端在线数量',data:[" + dataOnline + "]}, {name: '终端离线数量',data: [" + dataOffline + "]}]";

            return s;
        }

       
    }
}